<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui">

<f:view contentType="text/html">

<h:head>
	<title>Logística y Monitoreo</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

	<link rel="stylesheet" type="text/css" href="../css/demos.css"></link>

	<script type="text/javascript">
	
	</script>
	
</h:head>

<h:body>

   <h:form id="form">  		

   	<div id="header" class="ui-widget ui-widget-header">
			<div id="logo">
				<img src="../images/logo.png" alt="Logo" />
			</div>
	</div>
	

	<h1 class="title ui-widget-header ui-corner-all">Informe de auditoria</h1>

	<p:growl id="messages" showDetail="true"/>  
	
	<p:poll interval="3"  listener="#{informeAuditoriaBean.getLogs}"  update=":form:display" />  

   	<p:outputPanel id="display">
   		  	
   		
   		
   		<p:dataTable id="log" var="log" value="#{informeAuditoriaBean.logs}">  
	 
	  		<p:column headerText="Fecha y hora" style="text-align: center; width:15%">  
		            #{log.fecha}  
		    </p:column> 
	  
			<p:column headerText="Id Módulo" style="text-align: center; width:15%">  
		            #{log.idModulo}  
	        </p:column>  
	  
	        <p:column headerText="Mensaje" style="text-align: center; width:70%">  
	            #{log.mensaje}  
	        </p:column>  
  			
  			<p:column headerText="Enviar por mail" style="text-align: center; width:80px">  
     	          <p:commandButton id="enviar" action="#{informeAuditoriaBean.enviar}"  update=":form:messages, :form:display"  
     	          		process=":form:display"  icon="ui-icon-mail-closed" title="Enviar por mail"> 
               	 	<f:setPropertyActionListener value="#{log}" target="#{informeAuditoriaBean.log}" /> 
               	 	
               	 </p:commandButton>  
            </p:column>
	       
	        
		</p:dataTable>  
		
	</p:outputPanel>
	
	<br></br>   
  		<p:panel style="text-align: right">
					<p:commandButton id="menu" action="#{informeAuditoriaBean.volverAlMenu}" value="Volver al menú principal"></p:commandButton>
		</p:panel>
   
   </h:form>

</h:body>

</f:view>   

</html>